package org.geektimes.projects.user.management.configuration;

import org.geektimes.projects.user.management.HomeworkManager;

import javax.annotation.PostConstruct;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import java.lang.management.ManagementFactory;

/**
 @author :   chuan
 @date :   2021/03/17
 */
public class HomeworkManagerConfiguration {

    @PostConstruct
    public void init() throws Exception {
        MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();

        ObjectName objectName = new ObjectName("org.geektimes.projects.user.management:type=HomeworkManager");

        mBeanServer.registerMBean(new HomeworkManager(), objectName);
    }
}
